package com.javaxiaobear.module.system.domain;

import com.javaxiaobear.base.common.xss.Xss;
import com.javaxiaobear.base.framework.web.domain.BaseEntity;
import com.mybatisflex.annotation.Column;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.Table;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;
import lombok.Data;
import lombok.EqualsAndHashCode;

/**
 * 通知公告表 sys_notice
 *
 * @author javaxiaobear
 */
@EqualsAndHashCode(callSuper = true)
@Table(value = "sys_notice")
@Data
public class SysNotice extends BaseEntity {

  /** 公告ID */
  @Id private Long noticeId;

  /** 公告标题 */
  @Column(value = "notice_title")
  private String noticeTitle;

  /** 公告类型（1通知 2公告） */
  @Column(value = "notice_type")
  private String noticeType;

  /** 公告内容 */
  @Column(value = "notice_content")
  private String noticeContent;

  /** 公告状态（0正常 1关闭） */
  @Column(value = "status")
  private String status;

  @Xss(message = "公告标题不能包含脚本字符")
  @NotBlank(message = "公告标题不能为空")
  @Size(max = 50, message = "公告标题不能超过50个字符")
  public String getNoticeTitle() {
    return noticeTitle;
  }
}
